package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.WaterWorkOrderNew;
import com.ruoyi.system.mapper.WaterWorkOrderNewMapper;
import com.ruoyi.system.service.IWaterWorkOrderNewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 工作工单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-29
 */
@Service
public class WaterWorkOrderNewServiceImpl implements IWaterWorkOrderNewService 
{
    @Autowired
    private WaterWorkOrderNewMapper waterWorkOrderNewMapper;

    /**
     * 查询工作工单
     * 
     * @param id 工作工单主键
     * @return 工作工单
     */
    @Override
    public WaterWorkOrderNew selectWaterWorkOrderNewById(Long id)
    {
        return waterWorkOrderNewMapper.selectWaterWorkOrderNewById(id);
    }

    /**
     * 查询工作工单列表
     * 
     * @param waterWorkOrderNew 工作工单
     * @return 工作工单
     */
    @Override
    public List<WaterWorkOrderNew> selectWaterWorkOrderNewList(WaterWorkOrderNew waterWorkOrderNew)
    {
        return waterWorkOrderNewMapper.selectWaterWorkOrderNewList(waterWorkOrderNew);
    }

    /**
     * 新增工作工单
     * 
     * @param waterWorkOrderNew 工作工单
     * @return 结果
     */
    @Override
    public int insertWaterWorkOrderNew(WaterWorkOrderNew waterWorkOrderNew)
    {
        waterWorkOrderNew.setCreateTime(DateUtils.getNowDate());
        return waterWorkOrderNewMapper.insertWaterWorkOrderNew(waterWorkOrderNew);
    }

    /**
     * 修改工作工单
     * 
     * @param waterWorkOrderNew 工作工单
     * @return 结果
     */
    @Override
    public int updateWaterWorkOrderNew(WaterWorkOrderNew waterWorkOrderNew)
    {
        waterWorkOrderNew.setUpdateTime(DateUtils.getNowDate());
        return waterWorkOrderNewMapper.updateWaterWorkOrderNew(waterWorkOrderNew);
    }

    /**
     * 批量删除工作工单
     * 
     * @param ids 需要删除的工作工单主键
     * @return 结果
     */
    @Override
    public int deleteWaterWorkOrderNewByIds(Long[] ids)
    {
        return waterWorkOrderNewMapper.deleteWaterWorkOrderNewByIds(ids);
    }

    /**
     * 删除工作工单信息
     * 
     * @param id 工作工单主键
     * @return 结果
     */
    @Override
    public int deleteWaterWorkOrderNewById(Long id)
    {
        return waterWorkOrderNewMapper.deleteWaterWorkOrderNewById(id);
    }
}
